#!/bin/bash

# 删除旧的持久化文件
rm -f raft-state-*.json raft-snapshot-*.bin

# 在后台启动3个节点
go run cmd/server/main.go -id 1 -port 50051 &
sleep 1

go run cmd/server/main.go -id 2 -port 50052 &
sleep 1

go run cmd/server/main.go -id 3 -port 50053 &
sleep 2

# 启动客户端
go run cmd/client/main.go -server localhost:50051